﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OrderStart.aspx.cs" Inherits="Workflow.Project.CustomerFree" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <link rel="stylesheet" type="text/css" href="../Css/bootstrap.css" />
    <link rel="stylesheet" type="text/css" href="../Css/bootstrap-responsive.css" />
    <link rel="stylesheet" type="text/css" href="../Css/style.css" />
    <script type="text/javascript" src="../Js/jquery.js"></script>
    <script type="text/javascript" src="../Js/jquery.sorted.js"></script>
    <script type="text/javascript" src="../Js/bootstrap.js"></script>
    <script type="text/javascript" src="../Js/ckform.js"></script>
    <script type="text/javascript" src="../Js/common.js"></script>

    <style type="text/css">
        body {
            padding-bottom: 40px;
        }

        .sidebar-nav {
            padding: 9px 0;
        }

        @media (max-width: 980px) {
            /* Enable use of floated navbar text */
            .navbar-text.pull-right {
                float: none;
                padding-left: 5px;
                padding-right: 5px;
            }
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <table class="table table-bordered table-hover definewidth m10">
                <tr>
                    <td class="tableleft">样品订单流水号</td>
                    <td>
                        <asp:TextBox ID="txtSerialNum" runat="server" ReadOnly="true"></asp:TextBox></td>
                </tr>
                <tr>
                    <td class="tableleft">订单类型</td>
                    <td>
                        <asp:DropDownList ID="ddlOrderType" runat="server" Enabled="false">
                            <asp:ListItem Value="0">客户订单</asp:ListItem>
                            <asp:ListItem Value="1">维科自试模</asp:ListItem>
                        </asp:DropDownList></td>
                </tr>
                <tr>
                    <td class="tableleft">订单用途</td>
                    <td>
                        
                        <asp:DropDownList ID="ddlOrderPurpose" runat="server" Enabled="false">
                            <asp:ListItem Value="0"></asp:ListItem>
                            <asp:ListItem Value="1"></asp:ListItem>
                            <asp:ListItem Value="2">产线调试</asp:ListItem>
                            <asp:ListItem Value="3">其他试制</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td class="tableleft">项目责任人</td>
                    <td>
                        
                        <asp:DropDownList ID="ddlPerson" runat="server" Enabled="false">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td class="tableleft">数据同步</td>
                    <td>
                        <asp:TextBox ID="txtData" runat="server" Enabled="false"></asp:TextBox></td>
                </tr>
                <tr>
                    <td class="tableleft"></td>
                    <td>
                        <asp:Button ID="BtnSubmit1" CssClass="btn btn-primary" runat="server" Text="确定" OnClientClick="return ValidateCreate()" OnClick="BtnSubmit1_Click" Visible="false" />
                        <asp:Button ID="Update1" CssClass="btn btn-primary" runat="server" Text="确定" OnClientClick="return Validate()"  OnClick="Update1_Click" Visible="false"/>
                        <asp:Button ID="Update2" CssClass="btn btn-primary" runat="server" Text="确定" OnClientClick="return Validate()" OnClick="Update2_Click" Visible="false"/>
                        <asp:Button ID="BtnSubmit2" CssClass="btn btn-primary" runat="server" Text="数据同步" OnClientClick="return Validate()" OnClick="BtnSubmit2_Click" Visible="false" />
                    </td>
                </tr>
            </table>
                <table class="table table-bordered definewidth m10">
                <thead>
                    <tr>
                        <th>客户/部门</th>
                        <th>客户订单号</th>
                        <th>产品编号</th>
                        <th>Sap号</th>
                        <th>数量</th>
                        <th>模具号</th>
                        <th>确认送样日期</th>
                        <th>Sap订单号</th>
                        <th>备注</th>
                    </tr>
                </thead>
                <tbody id="Searchresult">
                    <tr class="result">
                        <td>
                            <asp:TextBox ID="txt0101" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0102" runat="server" Enabled="false"></asp:TextBox></td>
                        <td> 
                            <asp:TextBox ID="txt0103" runat="server" Enabled="false"></asp:TextBox></td>
                        <td> 
                            <asp:TextBox ID="txt01Matnr" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0104" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0105" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <input id="txt0106" name="txt0106" type="date" style="width: 174px" /></td>
                        <td>
                            <asp:TextBox ID="txt0107" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0108" runat="server" Rows="2" TextMode="MultiLine" Enabled="false"></asp:TextBox></td>
                    </tr>
                    <tr class="result">
                        <td>
                            <asp:TextBox ID="txt0201" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0202" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0203" runat="server" Enabled="false"></asp:TextBox></td>
                        <td> 
                            <asp:TextBox ID="txt02Matnr" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0204" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0205" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <input id="txt0206" name="txt0206" type="date" style="width: 174px" /></td>
                        <td>
                            <asp:TextBox ID="txt0207" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0208" runat="server" Rows="2" TextMode="MultiLine" Enabled="false"></asp:TextBox></td>
                    </tr>
                    <tr class="result">
                        <td>
                            <asp:TextBox ID="txt0301" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0302" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0303" runat="server" Enabled="false"></asp:TextBox></td>
                        <td> 
                            <asp:TextBox ID="txt03Matnr" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0304" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0305" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <input id="txt0306" name="txt0306" type="date" style="width: 174px" /></td>
                        <td>
                            <asp:TextBox ID="txt0307" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0308" runat="server" Rows="2" TextMode="MultiLine" Enabled="false"></asp:TextBox></td>
                    </tr>
                    <tr class="result">
                        <td>
                            <asp:TextBox ID="txt0401" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0402" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0403" runat="server" Enabled="false"></asp:TextBox></td>
                        <td> 
                            <asp:TextBox ID="txt04Matnr" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0404" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0405" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <input id="txt0406" name="txt0406" type="date" style="width: 174px" /></td>
                        <td>
                            <asp:TextBox ID="txt0407" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0408" runat="server" Rows="2" TextMode="MultiLine" Enabled="false"></asp:TextBox></td>
                    </tr>
                    <tr class="result">
                        <td>
                            <asp:TextBox ID="txt0501" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0502" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0503" runat="server" Enabled="false"></asp:TextBox></td>
                        <td> 
                            <asp:TextBox ID="txt05Matnr" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0504" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0505" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <input id="txt0506" name="txt0506" type="date" style="width: 174px" /></td>
                        <td>
                            <asp:TextBox ID="txt0507" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0508" runat="server" Rows="2" TextMode="MultiLine" Enabled="false"></asp:TextBox></td>
                    </tr>
                    <tr class="result">
                        <td>
                            <asp:TextBox ID="txt0601" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0602" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0603" runat="server" Enabled="false"></asp:TextBox></td>
                        <td> 
                            <asp:TextBox ID="txt06Matnr" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0604" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0605" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <input id="txt0606" name="txt0606" type="date" style="width: 174px" /></td>
                        <td>
                            <asp:TextBox ID="txt0607" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0608" runat="server" Rows="2" TextMode="MultiLine" Enabled="false"></asp:TextBox></td>
                    </tr>
                    <tr class="result">
                        <td>
                            <asp:TextBox ID="txt0701" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0702" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0703" runat="server" Enabled="false"></asp:TextBox></td>
                        <td> 
                            <asp:TextBox ID="txt07Matnr" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0704" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0705" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <input id="txt0706" name="txt0706" type="date" style="width: 174px" /></td>
                        <td>
                            <asp:TextBox ID="txt0707" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0708" runat="server" Rows="2" TextMode="MultiLine" Enabled="false"></asp:TextBox></td>
                    </tr>
                    <tr class="result">
                        <td>
                            <asp:TextBox ID="txt0801" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0802" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0803" runat="server" Enabled="false"></asp:TextBox></td>
                        <td> 
                            <asp:TextBox ID="txt08Matnr" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0804" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0805" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <input id="txt0806" name="txt0806" type="date" style="width: 174px" /></td>
                        <td>
                            <asp:TextBox ID="txt0807" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0808" runat="server" Rows="2" TextMode="MultiLine" Enabled="false"></asp:TextBox></td>
                    </tr>
                    <tr class="result">
                        <td>
                            <asp:TextBox ID="txt0901" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0902" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0903" runat="server" Enabled="false"></asp:TextBox></td>
                        <td> 
                            <asp:TextBox ID="txt09Matnr" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0904" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0905" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <input id="txt0906" name="txt0906" type="date" style="width: 174px" /></td>
                        <td>
                            <asp:TextBox ID="txt0907" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt0908" runat="server" Rows="2" TextMode="MultiLine" Enabled="false"></asp:TextBox></td>
                    </tr>
                    <tr class="result">
                        <td>
                            <asp:TextBox ID="txt1001" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt1002" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt1003" runat="server" Enabled="false"></asp:TextBox></td>
                        <td> 
                            <asp:TextBox ID="txt10Matnr" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt1004" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt1005" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <input id="txt1006" name="txt1006" type="date" style="width: 174px" /></td>
                        <td>
                            <asp:TextBox ID="txt1007" runat="server" Enabled="false"></asp:TextBox></td>
                        <td>
                            <asp:TextBox ID="txt1008" runat="server" Rows="2" TextMode="MultiLine" Enabled="false"></asp:TextBox></td>
                    </tr>
                </tbody>
            </table>
            
            <%--<div style="margin-right:20px"><a id="ShowHide" style="float:right">展开列表</a></div>--%>
        </div>
    </form>
    <script>
        $(document).ready(function () {
            <%if (result==null){%>
                SelectValue();
            <%}else{%>
                <%if (childListCount > 0){%>
                    <%if (result.ChildList[0].ConfirmDate.ToString("yyyy-MM-dd") =="1900-01-01" || result.ChildList[0].ConfirmDate.ToString("yyyy-MM-dd") =="1900-1-1"){%>
                        $("#txt0106").val("");
                    <%}else{%>
                        $("#txt0106").val("<% =result.ChildList[0].ConfirmDate.ToString("yyyy-MM-dd")%>")
                    <%}%>
                <%}%>
                <%if (childListCount > 1){%>
                   <%if (result.ChildList[1].ConfirmDate.ToString("yyyy-MM-dd") =="1900-01-01" || result.ChildList[1].ConfirmDate.ToString("yyyy-MM-dd") =="1900-1-1"){%>
                        $("#txt0206").val("");
                    <%}else{%>
                        $("#txt0206").val("<% =result.ChildList[1].ConfirmDate.ToString("yyyy-MM-dd")%>")
                    <%}%>
                <%}%>
                <%if (childListCount > 2){%>
                    <%if (result.ChildList[2].ConfirmDate.ToString("yyyy-MM-dd") =="1900-01-01" || result.ChildList[2].ConfirmDate.ToString("yyyy-MM-dd") =="1900-1-1"){%>
                        $("#txt0306").val("");
                    <%}else{%>
                        $("#txt0306").val("<% =result.ChildList[2].ConfirmDate.ToString("yyyy-MM-dd")%>")
                    <%}%>
                <%}%>
                <%if (childListCount > 3){%>
                    <%if (result.ChildList[3].ConfirmDate.ToString("yyyy-MM-dd") =="1900-01-01" || result.ChildList[3].ConfirmDate.ToString("yyyy-MM-dd") =="1900-1-1"){%>
                        $("#txt0406").val("");
                    <%}else{%>
                        $("#txt0406").val("<% =result.ChildList[3].ConfirmDate.ToString("yyyy-MM-dd")%>")
                    <%}%>
                <%}%>
                <%if (childListCount > 4){%>
                    <%if (result.ChildList[4].ConfirmDate.ToString("yyyy-MM-dd") =="1900-01-01" || result.ChildList[4].ConfirmDate.ToString("yyyy-MM-dd") =="1900-1-1"){%>
                        $("#txt0506").val("");
                    <%}else{%>
                        $("#txt0506").val("<% =result.ChildList[4].ConfirmDate.ToString("yyyy-MM-dd")%>")
                    <%}%>
                <%}%>
                <%if (childListCount > 5){%>
                    <%if (result.ChildList[5].ConfirmDate.ToString("yyyy-MM-dd") =="1900-01-01" || result.ChildList[5].ConfirmDate.ToString("yyyy-MM-dd") =="1900-1-1"){%>
                        $("#txt0606").val("");
                    <%}else{%>
                        $("#txt0606").val("<% =result.ChildList[5].ConfirmDate.ToString("yyyy-MM-dd")%>")
                    <%}%>
                <%}%>
                <%if (childListCount > 6){%>
                    <%if (result.ChildList[6].ConfirmDate.ToString("yyyy-MM-dd") =="1900-01-01" || result.ChildList[6].ConfirmDate.ToString("yyyy-MM-dd") =="1900-1-1"){%>
                        $("#txt0706").val("");
                    <%}else{%>
                        $("#txt0706").val("<% =result.ChildList[6].ConfirmDate.ToString("yyyy-MM-dd")%>")
                    <%}%>
                <%}%>
                <%if (childListCount > 7){%>
                    <%if (result.ChildList[7].ConfirmDate.ToString("yyyy-MM-dd") =="1900-01-01" || result.ChildList[7].ConfirmDate.ToString("yyyy-MM-dd") =="1900-1-1"){%>
                        $("#txt0806").val("");
                    <%}else{%>
                        $("#txt0806").val("<% =result.ChildList[7].ConfirmDate.ToString("yyyy-MM-dd")%>")
                    <%}%>
                <%}%>
                <%if (childListCount > 8){%>
                    <%if (result.ChildList[8].ConfirmDate.ToString("yyyy-MM-dd") =="1900-01-01" || result.ChildList[8].ConfirmDate.ToString("yyyy-MM-dd") =="1900-1-1"){%>
                        $("#txt0906").val("");
                    <%}else{%>
                        $("#txt0906").val("<% =result.ChildList[8].ConfirmDate.ToString("yyyy-MM-dd")%>")
                    <%}%>
                <%}%>
                <%if (childListCount > 9){%>
                    <%if (result.ChildList[9].ConfirmDate.ToString("yyyy-MM-dd") =="1900-01-01" || result.ChildList[9].ConfirmDate.ToString("yyyy-MM-dd") =="1900-1-1"){%>
                        $("#txt1006").val("");
                    <%}else{%>
                        $("#txt1006").val("<% =result.ChildList[9].ConfirmDate.ToString("yyyy-MM-dd")%>")
                    <%}%>
                <%}%>
            <%}%>
             <% if (pjCount==0 || statusNo!=2) {%>
                document.getElementById('txt0106').disabled = "disabled";
                document.getElementById('txt0206').disabled = "disabled";
                document.getElementById('txt0306').disabled = "disabled";
                document.getElementById('txt0406').disabled = "disabled";
                document.getElementById('txt0506').disabled = "disabled";
                document.getElementById('txt0606').disabled = "disabled";
                document.getElementById('txt0706').disabled = "disabled";
                document.getElementById('txt0806').disabled = "disabled";
                document.getElementById('txt0906').disabled = "disabled";
                document.getElementById('txt1006').disabled = "disabled";
            <%}%>
            $("#ddlOrderType").change(function () {
                SelectValue();
            });
        });

        function SelectValue() {
            if ($("#ddlOrderType").val()=="0") {
                $("#ddlOrderPurpose").empty();
                $("#ddlOrderPurpose").append("<option value='0'>免费订单</option>");
                $("#ddlOrderPurpose").append("<option value='1'>收费订单</option>");

            } else if ($("#ddlOrderType").val() == "1") {
                $("#ddlOrderPurpose").empty();
                $("#ddlOrderPurpose").append("<option value='0'>FOT首样</option>");
                $("#ddlOrderPurpose").append("<option value='1'>DB修模</option>");
                $("#ddlOrderPurpose").append("<option value='2'>产线调试</option>");
                $("#ddlOrderPurpose").append("<option value='3'>其他试制</option>");
            }
        }
        function ValidateCreate() {
            if ($("#txt0101").val().trim().length == 0) {
                alert("至少填写一行子项");
                return false;
            }
        }
    </script>
</body>
</html>
